<template>
  <div class="Word">
   <div style="height: 900px; width: auto"  v-html="poHtmlCode"></div>
  </div>
</template>

<script>
import axios from 'axios';
export default {
  name: "Word",
  data() {
    return {
      poHtmlCode:""
    }
  },
  created: function(){
	      //由于vue中的axios拦截器给请求加token都得是ajax请求，所以这里必须是axios方式去请求后台打开文件的controller
	      axios.post("/api/FileMakerConvertPDFs/edit?id="+this.$route.query.id).then((response) => {
	        this.poHtmlCode = response.data;
	
	      }).catch(function (err) {
	        console.log(err)
	      })
	    },
  methods: {
   Save() {
			pageofficectrl.WebSave();
		},
   OnPageOfficeCtrlInit() {
			pageofficectrl.AddCustomToolButton("保存", "Save()", 1);
		}
  },
  mounted: function () {
    //将vue中的方法赋值给window
    window.Save=this.Save;
    window.OnPageOfficeCtrlInit=this.OnPageOfficeCtrlInit;
  }
}
</script>
<style scoped>
#progressBarContainer {
		  width: 500px;
		  background-color: #e0e0e0;
		  border-radius: 5px;
		  padding: 3px;
		  margin: 10px auto;
		}

		#progressBar {
		  height: 20px;
		  width: 0%;
		  background-color: #76b900;
		  border-radius: 5px;
		  text-align: center;
		  line-height: 20px; /* 使文字垂直居中 */
		  color: white;
		}
</style>